import request from '@/utils/request'

// 查询费用报销列表
export function listOaExpense(query) {
  return request({
    url: '/expense/oaExpense/list',
    method: 'get',
    params: query
  })
}

// 根据费用类型查询费用报销列表
export function listOaExpenseByTypeArray(data) {
  return request({
    url: '/expense/oaExpense/listByTypeArray',
    method: 'post',
    data: data
  })
}

//
export function listOaExpenseByResult(query) {
  return request({
    url: '/expense/oaExpense/listByResult',
    method: 'get',
    params: query
  })
}

// 查询费用报销详细
export function getOaExpense(id) {
  return request({
    url: '/expense/oaExpense/' + id,
    method: 'get'
  })
}

// 保存费用报销
export function saveOaExpense(data) {
  return request({
    url: '/expense/oaExpense/save',
    method: 'post',
    data: data
  })
}

// 删除费用报销
export function delOaExpense(id) {
  return request({
    url: '/expense/oaExpense/' + id,
    method: 'delete'
  })
}

// 导出费用报销
export function exportOaExpense(query) {
  return request({
    url: '/expense/oaExpense/export',
    method: 'get',
    params: query
  })
}

// 删除费用明细
export function deleteOaExpenseDetail(id) {
  return request({
    url: '/expense/oaExpense/detail/' + id,
    method: 'delete'
  })
}

// 删除分摊主体
export function delOaExpenseInvestor(id) {
  return request({
    url: 'expense/oaExpense/investor/' + id,
    method: 'delete'
  })
}

// 是否已经存在前台传递来的发票号码
export function checkInvoiceCode(query) {
  return request({
    url: '/expense/oaExpense/checkInvoiceCode',
    method: 'get',
    params: query
  })
}

// 维护付款时间
export function updatePayTime(id, payCompletionTime) {
  const data = {
    id,
    payCompletionTime
  }
  return request({
    url: '/expense/oaExpense/updatePayTime',
    method: 'post',
    data: data
  })
}

// 费用明细小问号内容
export function getInfoType() {
  return request({
    url: '/expense/oaExpense/getInfoType',
    method: 'get'
  })
}
